Hi people. I've finally converted to linux, and I'm starting to explore the amazing capabilities of the terminal. At the moment in trying to learn how to extract text using the "grep" and "sed" command. I decided to learn by trying to figure out how to solve a practical problem. I have a schedule in the form of a text file, and im trying to write a simple script that will convert it into a .csv file to be used in calendars like gcal (we get a schedule like this every semester, and manually editing it is a daunting task). My plan is to finally write a script that would do the job for me. I decided to post my "project" here instead of making multiple posts.
I've managed to do some extracting (im sure not in the most efficient way) and have come across some problems which i haven't been able to solve on my own. I absolutely do not expect someone to do the entire job for me, just would be nice on some tips if some of you guys have the time. I will post my progress so far, and the my main problems at the end.
So this is the headers for the .csv im planning to make
so like this
The text file comes in this format
1. i did
to remove the header and recurring week.
2. Then i tried doing
to remove the Day: string, but was unable to figure out a wildcard for spaces and was left with "/"s, so i decided to do
instead.
3. I removed the entries that didnt fit my study group (im in group 4/2,4,). First by
and then the remaining group numbers as i dont need them
This is my output so far:
And now comes my problems:
First i need to move the date from its line and infront of each subject belonging to this date and duplicate it so that the format becomes like this
I have no idea on how to do this.
And then second i need to use
(i guess) to replace spaces with commas. This is no problem but as you can see some of the headers has a single space in it. This happens for subject and location. But im thinking maybe since there are multiple spaces between subject and location, and each location starts with a number this might be used.
Anyways this turned out to be a very long post. I apologize, and i hope i posted in the right forum. As i said before i do not expect anyone to do the work for me, but any tips regarding any of the sections are more than welcome
HI guys,
I have created a script to read 1 column in a csv file and then place it in text file.
However, when i checked out the text file, it is not in a column format...
Example:
CSV file contains
name,age
aa,11
bb,22
cc,33
After using awk to get first column
TXT file... (1 Reply)
Hi,
i don't know anything about PERL. Can anyone help me providing PERL scripts for
1. converting XLS to CSV (and vice-versa)
2. converting DOC/RTF to TXT
Thanks much
Prvn (1 Reply)
Hi,
I was trying some split command to pull out values like "uid=abc,ou=INTERNAL,ou=PEOPLE" into a csv file. However because of erratic nature of occurrance of rows made me stopped. Could someone help me in this? and if someone has a one liner for this?
The text file contain pattern like this... (14 Replies)
Hi - I am looking to convert the following text to csv. The columns may not always have data in them and they may have varying spaces but I still need to have a comma there anyway:
Sample Data:
~~~~~~~
Name Email Location Phone
Tom... (4 Replies)
hi..
I have a text file which looks likes this
2258
4569
1239
258
473
i need to convert it into comma seperated format
eg:2258,4569,1239,258,437
pls help (8 Replies)
Hi Team,
i have some script which give output in TXT format , need script to convert TXT file into CSV.
Output.TXT
413. U-UU-LVDT-NOD-6002 macro_outcome_dist-8.0.0(v1_0_2) KK:1.2.494 (1234:333:aaa:2333:3:2:333:a)
414. U-UU-LVDT-NOD-6004 ... (10 Replies)
Hello friends,
I need to convert ASCII text to PDF on RHEL 6 so I did the below and could generate PDF but it has lot of junk/special characters.
yum install enscript ghostscript
enscript -p output.ps input.txt
ps2pdf output.ps output.pdf
So I download latest source of Ghostscript... (4 Replies)
Hello Unix gurus,
I am learning unix. I have lots pdf data files. I need to convert them into txt files. Can you please guide me how to do that?
Thanks in advance.
Rao (1 Reply)
Hi ,
I have a Txt file which consist of 1000's of SOAP request and response and i want the file to be converted to a csv file like column a should have a soap request and column b should have the soap response . can someone assist me in achieving this please ?
Thanks (2 Replies)