remove comma from end of field

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
sheridany
Posts: 36
Joined: Thu Nov 15, 2007 4:20 am

remove comma from end of field

Post by sheridany »

I am using the remove delimited fields to retain certain csv fields into a output file and a comma is remaining after the last field that I need to remove as well.
It looks like this after processing the remove delimited fields. I need to get rid of the last comma.

field1, field2, field3,
abc, def, ghi,
jkl, mno, pqr,

Any suggestions. I have tried using [TextEnd] etc and nothing gets rid of it. I just want it to be blank at the end of the line.
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Post by DataMystic Support »

Hi Sheridan,

Try the EasyPattern:

Code: Select all

,[LineEnd]
sheridany
Posts: 36
Joined: Thu Nov 15, 2007 4:20 am

That Worked!

Post by sheridany »

Thanks!
:D
sheridany
Posts: 36
Joined: Thu Nov 15, 2007 4:20 am

One more small thing

Post by sheridany »

I only want the lines where the csvfield 2 called q2oe is not null.
tracknum,q2oe
7482-005544-6953
7482-005543-8801,"Because they
482-005531-2330
7482-005538-9415
7482-005538-8759
7482-005538-0158
7482-005545-8564
7482-005538-2549
7482-005544-2431
7482-005574-8737,He neglected
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Post by DataMystic Support »

I assume this is a new request unrelated to the old one.

So...

Use a Remove Lines Not Matching EasyPattern:
[ LineStart, 0+ not comma, comma ]
sheridany
Posts: 36
Joined: Thu Nov 15, 2007 4:20 am

Post by sheridany »

Same project. I just needed the last filter to delete the records with no second csv field populated. It worked perfectly.
Post Reply