ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm assuming that Toronto MDS_GW2 is not unique, so I used /\// which looks for a forward slash (which needs to be escaped, it has special meaning in awk). I also believe $3 should be $4.
when i tried to run that i got the following:
Code:
-bash-3.2$ ./split.sh
awk: cmd. line:6: (FILENAME=testing-split.csv FNR=1) fatal: expression for `>' redirection has null string value
-bash-3.2$ awk -f split.sh
awk: split.sh:3: awk -F"/" '
awk: split.sh:3: ^ invalid char ''' in expression
??? more information please. You opened what file? the only way a space could be presented is if it were in your original file.
in the original data file testing-split.csv the dumb output program puts a space at the top oof the file so instead of teh data starting on line 1 it starts on line 2. That space was the issue and giving off that error. Just wondering how i can get awk to skip the first line or even just remove it before running.
in the original data file testing-split.csv the dumb output program puts a space at the top oof the file so instead of teh data starting on line 1 it starts on line 2. That space was the issue and giving off that error. Just wondering how i can get awk to skip the first line or even just remove it before running.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.