![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to extract data from a huge file? | srsahu75 | Shell Programming and Scripting | 5 | 01-18-2008 05:06 AM |
| Shell script to check the unique numbers in huge data | namishtiwari | Shell Programming and Scripting | 7 | 08-10-2007 09:38 AM |
| How to grab data between 2 strings ? | Raynon | Shell Programming and Scripting | 16 | 10-06-2006 10:37 AM |
| Search file for pattern and grab some lines before pattern | frustrated1 | Shell Programming and Scripting | 2 | 12-22-2005 03:41 PM |
| How to Grab the latest file | n9ninchd | UNIX for Dummies Questions & Answers | 1 | 05-10-2001 04:31 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
folks,
In my working directory, there a multiple large files which only contain one line in the file. The line is too long to use "grep", so any help? For example, if I want to find if these files contain a string like "93849", what command I should use? Also, there is oder_id number inside the line, just a part of the line, the format is : .....<order_id>92873</order_id>....., how can I grab all the order ids from these file? Thanks and have a nice day!!! ![]() |
|
||||
|
Try this
Hi, I had the same issue with a large XML file being on one line. If you have Pearl on your server, you can use this command to add carriage returns after the closing xml tags so you can use the sed command.
cat $file | perl -p -i -e 's@><@>\n<@g' > `echo ${file} | cut -d. -f1`_broken.xml Replace "$file" with your filename. This will create a copy of the file called filename_broken.xml with carriage returns. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|