If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Filter rows in sql file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-17-10, 09:02
nerak99 nerak99 is offline
Registered User
 
Join Date: Feb 2010
Posts: 7
Filter rows in sql file

I have a 50000 line(ish) set of records in a file. I have another file where I have filtered out all the line numbers for those which have an error of various types. e.g column count, field type etc. I want to get all those lines into a separate file so I can sanitise them. There are abt 3-4000 of them.

How can I access those lines which I want to isolate into a single file?

I have all the usual linux stuff available and a bit of understanding of regexps.
Reply With Quote
  #2 (permalink)  
Old 02-17-10, 09:33
mike_bike_kite mike_bike_kite is offline
vaguely human
 
Join Date: Jun 2007
Location: London
Posts: 2,519
This doesn't appear to be a MySQL issue so unless you object I'll move it to the Unix forum. You want to be looking at the grep command though. You haven't given any examples of what text you want to look for so I can't be any more specific than:

Code:
grep "Error" MyOriginalFile.txt > JustTheErrors.txt
You'd run this command at the linux command prompt.

Mike
Reply With Quote
  #3 (permalink)  
Old 02-17-10, 09:41
nerak99 nerak99 is offline
Registered User
 
Join Date: Feb 2010
Posts: 7
Thanks, and that does help. I don't mind the tfr either :-)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On