The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-06-2006
ting123 ting123 is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 25
Question search and grab data from a huge file

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!!!
  #2 (permalink)  
Old 06-06-2006
cgunn23 cgunn23 is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 1
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.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:38 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0