# Parse text file using JS

**URL:** <https://forum.kirupa.com/t/parse-text-file-using-js/178837>\
**Category:** Uncategorized\
**Created:** [February 14, 2006, 5:41pm UTC](https://forum.kirupa.com/t/parse-text-file-using-js/178837 "2006-02-14T17:41:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlk](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@mlk](https://forum.kirupa.com/u/mlk)\
**Post date:** [February 14, 2006, 5:41pm UTC](https://forum.kirupa.com/t/parse-text-file-using-js/178837/1 "2006-02-14T17:41:03Z")

</div>

Hello little kirupians, here’s a little question for you:

I have a text file, written in such way

```auto

imagepath1/imageA.jpg
imagepath2/imageB.jpg
imagepath3/imageC.jpg
imagepath4/imageD.jpg
...

```

(the .txt is actually 1Mib large)

Can I parse this text file in an html page using javascript, so each line belongs to an array ? Using split works for characters, but could it work with the linebreak ?

thanks

mlk

ps: if anyone knows a way to declare a large chunk of text as a variable (I can’t seem to be able to use multi-line variable withouth writing ‘’ at the end of each line), it would help me greatly !
