LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-18-2012, 04:46 PM   #16
atjurhs
Member
 
Registered: Aug 2012
Posts: 307

Original Poster
Rep: Reputation: Disabled

markush, I could get the perl script to run on some files, but not on others and I couldn't see what the difference between the ones that worked and the ones that didn't

allend, so far your sed script has worked on all the files I run I just had to figure out the character count to my bad column

grail, I can do a little awk, a little sed, and a little bash, this was the first time I tried perl and wasn't to lucky. I'm a little skitzy about adding another scripting language.
 
Old 12-18-2012, 05:15 PM   #17
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Can you post an example that does work and one that doesn't?
 
1 members found this post helpful.
Old 12-18-2012, 07:52 PM   #18
atjurhs
Member
 
Registered: Aug 2012
Posts: 307

Original Poster
Rep: Reputation: Disabled
I work (for very little pay) for the AmericanRedCross, and in that file there is personal information of people who support us, so the file is on a protected LAN, and I'm not supposed to take any files off of it. I could get in big trouble, sorry, but you guys are being a huge help, and I wouldn't be able to do my work without your help!

Tabitha
 
Old 12-19-2012, 01:49 AM   #19
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,005

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
So make a mock file of the same format with bogus data, but duplicates the issues.

Also here is an awk for you although it messes with the formatting on the lines that need changing:
Code:
awk 'NF == 4{for(i=NF;i>=1;i--)if(i+1==2)$(i+1)=0;else$(i+1)=$i}1' OFS="\t" file

Last edited by grail; 12-19-2012 at 01:57 AM.
 
1 members found this post helpful.
Old 12-19-2012, 07:16 AM   #20
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
This
Quote:
So make a mock file of the same format with bogus data, but duplicates the issues.
exactly
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Over my head with this problem - Access the data in .fbd data file BobNutfield Linux - Server 3 02-20-2011 01:48 PM
Weird xmgrace problem:Missing import data options Euler2 Linux - Software 1 04-13-2010 12:07 PM
Tough exmh/mh question - /etc/aliases file cskip Linux - Software 2 07-29-2009 11:34 AM
Sort file based on only ONE colum smart_sagittari Linux - Newbie 6 07-08-2005 12:25 AM
gprof: gmon.out file is missing call-graph data hemk76 Programming 0 01-07-2005 11:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:28 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration