473,378 Members | 1,394 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Exporting list of text between delimeters

Hiya all,

New to this forum.. It looks like perl can do a real nice job of extracting text and more. How can i extract a bunch of text in a large 77 page text file "document1.txt" where it contains text between brackets..

For example:

This is a test document of [widget1] and [object2]. It contains many,
many lines of text and [words3].

Where the output file would be:

widget1
object2
words3

After i get the hang of it, i'll see if i can do the fine adjustments myself.
Thanks :)

Mike
Mar 13 '07 #1
1 1149
KevinADC
4,059 Expert 2GB
Expand|Select|Wrap|Line Numbers
  1. perl -ne "s/\[([^\]]+)\]/print $1.\"\n\"/eg" document1.txt > output.txt
You might have to change the outside double-quotes to single-quotes on your system.
Mar 13 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Rene | last post by:
Hi, i'm a newbie at java and have a question for beginners. So i'm try to create a type of parser for a input-string. i take a StringTokenizer to cut the Sting into token. But i want, that the...
1
by: Joe Saliba | last post by:
hello, i would like to know please if there's any mean to change delimeters (, or ;) and text qualifiers in a file in a i/o file written in vb ex: open #1 for ... write #1 ... thx *** Sent...
4
by: D | last post by:
I've created a report with many subreports of aggregate data. I want my client to be able to export this data to Excel to make her charts, etc. Only one problem: one of the fields is a "SchoolYear"...
2
by: Kenneth | last post by:
How do I remove the limitation in Access that deny me from exporting 24000 rows and 17 columns (in a query) into Excel? Kenneth
1
by: Steemer | last post by:
Okay, I checked with usual suspects and I'm still frustrated. ..txt file, fixed width. About 88 fields of varying length. All text fields. It will only let me add seperators to about the 410th...
2
by: Joe Saliba | last post by:
hi, we're trying to output a text file in other format including delimeters (; instead of , ) and changing text delimeters too any way to do it from vb ?? thx *** Sent via Developersdex...
6
by: sara | last post by:
I have what I think is a little strange...I have to get data from our payroll system into a specific format (fixed record length) as a .txt or .prn file only to upload to our 401k custodian. I...
0
by: =?Utf-8?B?ZGVuIDIwMDU=?= | last post by:
hi, I trying to export data display on a gridview that supports any language (like chinese, japanese, thai, french) shown here is chinese only. There is no problem exporting english language...
1
by: Marty Klunk | last post by:
I have an Access97 data base where we are exporting records out to a text file that is then sent to a customer via EDI transmission. The problem I am having is that during the export process access...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.