LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 01-31-2007, 12:51 AM   #1
powah
Member
 
Registered: Mar 2005
Distribution: FC, Gentoo
Posts: 276

Rep: Reputation: 30
delete columns 15 to 27 of a text file


How to delete columns 15 to 27 of a text file?
Any programming language is ok.
Thanks.
e.g.
Input:
Sep. 30, 2006 Oct. 04, 2006 PIZZA PIZZA #222 $8.75
Oct. 01, 2006 Oct. 04, 2006 BURGER KING #8818 $9.10
Oct. 02, 2006 Oct. 03, 2006 NEW GREAT WALL RESTAURANT $38.10

Output:
Sep. 30, 2006 PIZZA PIZZA #222 $8.75
Oct. 01, 2006 BURGER KING #8818 $9.10
Oct. 02, 2006 NEW GREAT WALL RESTAURANT $38.10
 
Old 01-31-2007, 02:03 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Location: the Netherlands
Distribution: lfs, debian, rhel
Posts: 7,515
Blog Entries: 1

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Hi,

Here's one way, using the cut command:

cut -d" " -f1-3,7- infile

Hope this helps.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete the first row from a text file loopoo Linux - Newbie 2 08-15-2006 02:57 AM
text data conversion: rows into columns frankie_DJ Programming 6 06-03-2006 06:43 AM
delete chunks or regions from text file - help K3vin Linux - Software 3 09-26-2005 02:57 AM
Delete line from flat text file in C zaichik Programming 6 01-26-2005 06:16 PM
How to delete a line from a text file with shell script programming Bassam General 1 01-28-2004 08:51 PM


All times are GMT -5. The time now is 04:41 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration