# Flat File Delimiter Issue

**URL:** <https://techcommunity.softwareag.com/t/flat-file-delimiter-issue/108070>\
**Category:** Forum\
**Tags:** EDI\
**Created:** [February 26, 2003, 4:23am UTC](https://techcommunity.softwareag.com/t/flat-file-delimiter-issue/108070 "2003-02-26T04:23:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [February 26, 2003, 4:23am UTC](https://techcommunity.softwareag.com/t/flat-file-delimiter-issue/108070/1 "2003-02-26T04:23:54Z")

</div>

I created a generic Flat File Schema template to test writing out a flat file that was fixed position. (columns 0-3 are id, 4-10 are data). I wrote it out (using the [Sample.IO](http://Sample.IO) package file handlers, not the inherent, and as far as I can tell undocumented, outputFileName field in convertToString) to a file and everything looked fine. However, according to the ConvertToString documentation, I can set record, field, and sub-field delimiters. When I set these values in the ConvertToString flow, however, it doesn’t do anything. It’s the same output no matter what I put in these fields. Has anyone gotten these delimiters to work? If so, what do I need to do to get them to work? If I pass multiple records to convertToString, it handles it fine, except that it ignores my delimeters.

Any help would be great! I’m stuck!

Jamie Stanton  
Innotrac

---

<div class="post-metadata">

**Author:** ![reamon](https://avatars.discourse-cdn.com/v4/letter/r/b77776/32.png) [@reamon](https://techcommunity.softwareag.com/u/reamon)\
**Post date:** [February 26, 2003, 5:01am UTC](https://techcommunity.softwareag.com/t/flat-file-delimiter-issue/108070/2 "2003-02-26T05:01:50Z")

</div>

I believe you specify the delimiters in the template.

---

<div class="post-metadata">

**Author:** ![jakelee](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@jakelee](https://techcommunity.softwareag.com/u/jakelee)\
**Post date:** [February 26, 2003, 5:41am UTC](https://techcommunity.softwareag.com/t/flat-file-delimiter-issue/108070/3 "2003-02-26T05:41:37Z")

</div>

Well, normally, there are two types of flat file formats, either fixed length (position-based) or delimited (with delimiter). If you want to output fixed-length file, you don’t need delimiters…will look at it later…

---

<div class="post-metadata">

**Author:** ![cowens](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@cowens](https://techcommunity.softwareag.com/u/cowens)\
**Post date:** [February 26, 2003, 11:53am UTC](https://techcommunity.softwareag.com/t/flat-file-delimiter-issue/108070/4 "2003-02-26T11:53:13Z")

</div>

You will find the answers to your questions in developer\plugins\flatfileplugin\doc\ISFlatfileSchema.pdf.

If you are using 6.0.01 youwill find a shockwave demo file showing you (step-by-step) how to do what you are trying to do. Access to the demo is via the home page icon of the WmFlatFileSamples package under the Manager hyperlink of the Administrator Browser.

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [February 26, 2003, 9:49pm UTC](https://techcommunity.softwareag.com/t/flat-file-delimiter-issue/108070/5 "2003-02-26T21:49:23Z")

</div>

Hmmmm… I don’t have the WmFlatFileSamples package, so I’m guessing I haven’t picked up 6.0.01 yet. I’ll look for that. From what y’all are saying, though, I’m guessing that I have to pick one or the other. Which is generally fine, with the exception of a record delimiter, which is quite useful even in fixed position formats by placing a newline after each record. I tried adding a “dummy” 1 character field to the record and defaulting it’s value to \n, but that didn’t work. I just got the "", it didn’t seem to want to read it as a single character. I can do it the hard way, looping and only ever passing 1 record to the convertToString method, but that seems limiting. Is there anyway that I can tell it to put a newline after each record of my fixed position flat file? Thanks for all your help!

Jamie Stanton  
Innotrac

---

<div class="post-metadata">

**Author:** ![reamon](https://avatars.discourse-cdn.com/v4/letter/r/b77776/32.png) [@reamon](https://techcommunity.softwareag.com/u/reamon)\
**Post date:** [February 26, 2003, 11:43pm UTC](https://techcommunity.softwareag.com/t/flat-file-delimiter-issue/108070/6 "2003-02-26T23:43:22Z")

</div>

\n is a special literal that is automatically converted to 0x0a by compilers and sometimes by services within the wM IS environment (e.g. convertToString will convert it when passed as one of the delimiter parameters).

If you wish to use \n (or \r, \t, etc.) outside of these cases, you have to do the conversion yourself. Do a search in [wmusers.com](http://wmusers.com) for “toChar” which is a service that will do this conversion for you. You can place the resulting char in your dummy record field.

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [February 27, 2003, 4:07am UTC](https://techcommunity.softwareag.com/t/flat-file-delimiter-issue/108070/7 "2003-02-27T04:07:09Z")

</div>

Thanks Rob! That did it. I added an extra field called newLine to my record that was 1 character long, used toChar and it worked great. Thanks everyone!

Jamie Stanton  
Innotrac

---

<div class="post-metadata">

**Author:** ![claire](https://avatars.discourse-cdn.com/v4/letter/c/f6c823/32.png) [@claire](https://techcommunity.softwareag.com/u/claire)\
**Post date:** [August 7, 2003, 2:40pm UTC](https://techcommunity.softwareag.com/t/flat-file-delimiter-issue/108070/8 "2003-08-07T14:40:43Z")

</div>

Hi! I was very pleased to read your messages here, I’m having the same problem: a flat file with fixed lenght, but after every record a carriage return must be added.  
What I did so far: in the schema I added a dummy field in each record, I filled this field with the outcome of the toChar service.  
This doe not work for me??  
Any suggestions?

---

<div class="post-metadata">

**Author:** ![Chris\_L](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@Chris\_L](https://techcommunity.softwareag.com/u/Chris_L)\
**Post date:** [August 8, 2003, 7:23am UTC](https://techcommunity.softwareag.com/t/flat-file-delimiter-issue/108070/9 "2003-08-08T07:23:52Z")

</div>

Claire, if you are using the schema editor in wm 6.01, try this.  
on the Flat File Definition tab  
under Record Parser select Delimiter  
Under Record select Character and in the selection box select Newline from the drop down.

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [June 3, 2005, 6:16pm UTC](https://techcommunity.softwareag.com/t/flat-file-delimiter-issue/108070/10 "2005-06-03T18:16:47Z")

</div>

Hi ,  
I am facing the opposite problem… I have my record parser as Delimiter. The record delimiter that I am using is a newline. However, the convertToString service is adding an extra delimiter to all my records…i.e, all the records are separated by two newlines. Help me out!

---

<div class="post-metadata">

**Author:** ![gupta\_r.17495](https://avatars.discourse-cdn.com/v4/letter/g/9fc348/32.png) [@gupta\_r.17495](https://techcommunity.softwareag.com/u/gupta_r.17495)\
**Post date:** [June 3, 2005, 7:04pm UTC](https://techcommunity.softwareag.com/t/flat-file-delimiter-issue/108070/11 "2005-06-03T19:04:43Z")

</div>

Salonia,

Did you tried with carriagereturn as well?,unless you set extra delimiter convertToString dont add extra delimiter.Please make sure.

HTH,  
RMg

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [June 6, 2005, 8:50am UTC](https://techcommunity.softwareag.com/t/flat-file-delimiter-issue/108070/12 "2005-06-06T08:50:30Z")

</div>

Hi rmg,  
Yes, I tried with carriage return, but that too did not work. I have not added extra delimiter anywhere, just defined the delimiter once in the schema. Is this some bug with convertToString…??  
Saloni

---

<div class="post-metadata">

**Author:** ![Chris\_L](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@Chris\_L](https://techcommunity.softwareag.com/u/Chris_L)\
**Post date:** [June 7, 2005, 12:33am UTC](https://techcommunity.softwareag.com/t/flat-file-delimiter-issue/108070/13 "2005-06-07T00:33:42Z")

</div>

Are you moving the file between Unix and Windows?  
Take a look at the file in an Hex editor like debug on windows or Ultraedit. You probably have embedded carriage return/line Feed in the file.

hth

---

<div class="post-metadata">

**Author:** ![Vivian\_Satie1](https://avatars.discourse-cdn.com/v4/letter/v/ac91a4/32.png) [@Vivian\_Satie1](https://techcommunity.softwareag.com/u/Vivian_Satie1)\
**Post date:** [July 25, 2007, 8:48pm UTC](https://techcommunity.softwareag.com/t/flat-file-delimiter-issue/108070/14 "2007-07-25T20:48:15Z")

</div>

I need some help. I´ve created a flat file schema but I still have delimiters problems.

I need to retrieve some data (for exemple: 001) after a specific string : order 001

Remembering that I have an amount of data together : id 102 order 001 date 230407

Any ideas how to do it?

Thanks

---

<div class="post-metadata">

**Author:** ![gupta\_r.17495](https://avatars.discourse-cdn.com/v4/letter/g/9fc348/32.png) [@gupta\_r.17495](https://techcommunity.softwareag.com/u/gupta_r.17495)\
**Post date:** [July 25, 2007, 9:08pm UTC](https://techcommunity.softwareag.com/t/flat-file-delimiter-issue/108070/15 "2007-07-25T21:08:37Z")

</div>

Please elaborate more about your FFSchema details?? Is your flatfile is fixed-length and delimited?? If it is fixed length you can specify start/end positions and extract the value??

HTH,  
RMG

---

<div class="post-metadata">

**Author:** ![Vivian\_Satie1](https://avatars.discourse-cdn.com/v4/letter/v/ac91a4/32.png) [@Vivian\_Satie1](https://techcommunity.softwareag.com/u/Vivian_Satie1)\
**Post date:** [July 25, 2007, 9:13pm UTC](https://techcommunity.softwareag.com/t/flat-file-delimiter-issue/108070/16 "2007-07-25T21:13:41Z")

</div>

Hi,

It´s delimited. I cannot use fixed-length because the amount of data could be variable. I believe the solution is getting the data after an specific word. ☹

---

<div class="post-metadata">

**Author:** ![Percio\_Castro](https://avatars.discourse-cdn.com/v4/letter/p/91b2a8/32.png) [@Percio\_Castro](https://techcommunity.softwareag.com/u/Percio_Castro)\
**Post date:** [July 26, 2007, 7:57pm UTC](https://techcommunity.softwareag.com/t/flat-file-delimiter-issue/108070/17 "2007-07-26T19:57:36Z")

</div>

Vivian,

Will the data always appear in the same location? For example, in the sample you provided: id 102 order 001 date 230407

id comes first, order comes second, and date comes third. Will that always be the case?

If so, then you could use a flat file schema with a delimiter (a space, it appears) and then always assume that the 4th field is the order ID (in this case, 001).

If not, then I don’t know that using the flat file schema to break down the fields will really buy you much. You might be better off just reading each line, passing the entire line to the service pub.string:tokenize, and then loop over the tokens. Once you find the token that you’re looking for (in this case, the word order), you can assume that the next token is the value you need.

Let me know if this makes sense.

- Percio

---

<div class="post-metadata">

**Author:** ![Vivian\_Satie1](https://avatars.discourse-cdn.com/v4/letter/v/ac91a4/32.png) [@Vivian\_Satie1](https://techcommunity.softwareag.com/u/Vivian_Satie1)\
**Post date:** [July 26, 2007, 9:19pm UTC](https://techcommunity.softwareag.com/t/flat-file-delimiter-issue/108070/18 "2007-07-26T21:19:26Z")

</div>

Hi Percio! How u doing?

Perfect! That´s the idea! I´ll try this using pub.string:tokenize!

Thanks a lot!  
Vivian

---

<div class="post-metadata">

**Author:** ![gupta\_r.17495](https://avatars.discourse-cdn.com/v4/letter/g/9fc348/32.png) [@gupta\_r.17495](https://techcommunity.softwareag.com/u/gupta_r.17495)\
**Post date:** [July 26, 2007, 9:39pm UTC](https://techcommunity.softwareag.com/t/flat-file-delimiter-issue/108070/19 "2007-07-26T21:39:29Z")

</div>

But if you use pub.string:tokenize then you got to do lot of manipulation to extract the values incase you file has lot of rows/lines…its ok if you are satisfied doing this.just curious.

Is this solution not feasible for you ie. to put in the Schema side which was told above??  
"id comes first, order comes second, and date comes third. Will that always be the case?"

HTH,  
RMG

---

<div class="post-metadata">

**Author:** ![Vivian\_Satie1](https://avatars.discourse-cdn.com/v4/letter/v/ac91a4/32.png) [@Vivian\_Satie1](https://techcommunity.softwareag.com/u/Vivian_Satie1)\
**Post date:** [July 26, 2007, 9:43pm UTC](https://techcommunity.softwareag.com/t/flat-file-delimiter-issue/108070/20 "2007-07-26T21:43:34Z")

</div>

Hello,

Data does not appear in the same location. But now… how to specify the string I´m looking for?

Tks  
Vivian

[Next page](https://techcommunity.softwareag.com/t/flat-file-delimiter-issue/108070.md?page=2)
