Solved

big tarfiles to lex

Posted on 1997-12-01
2
209 Views
Last Modified: 2010-04-21
I've very big tar-files with eMails in it.
My lex-Programm should work with the content of these files.
The Problem: When I pipe it to lex like this:
more tarfile | lexprogram >output
it ends with a broken pipe.
When I try it like this
lexprogram <tarfile >output
the program will abbort after the same time (I guess yywrap stopps the program).
0
Comment
Question by:bodirsky
2 Comments
 

Expert Comment

by:xilef
ID: 2008170
Hm, shouldn't you first extract your tarfile?

Something like:
cd /tmp/mydir
tar -xf /path/to/my/tarfile.tar
cat * | lexprogram

(The last line should probably be a loop for each of the files if there are really MANY files. The loop depends on the shell).

0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 50 total points
ID: 2008171
tar files contain null bytes (0x0). Most lex flaviours treat this as an EOF. Your must take care for them before the default action (.)
Check your lex manual, or switch over to flex (which can handle null bytes ;-)
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question