LinuxQuestions.org
Visit Jeremy's Blog.
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 10-21-2012, 06:07 PM   #1
demet8
LQ Newbie
 
Registered: Sep 2012
Posts: 9

Rep: Reputation: Disabled
How to cut a column from a file that's requested by a user


This is what I need to do:

cut a column from a file called example_1 that's requested by the user. The script will prompt for a field that will become a
variable used to cut the field requested.

This is what I have tried and it hasn't worked. How can I simply this issue.

@ a = cut -c
echo -n "enter a field to cut "
set b = $<

@d = $a , $b

echo $d
 
Old 10-21-2012, 06:32 PM   #2
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,261

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
Which language is this? It looks similar to eg bash, but not valid syntax.
If you did mean bash, have a look at these
http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/
 
Old 10-21-2012, 06:45 PM   #3
demet8
LQ Newbie
 
Registered: Sep 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
It's csh. I will take a look at what you posted. Thank you.
 
Old 10-21-2012, 06:58 PM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,261

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
Re csh

http://www.grymoire.com/Unix/CshTop10.txt
http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/
 
  


Reply

Tags
bash scripting, cut, variables


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
cut column ust Linux - Server 8 07-02-2012 11:02 PM
compare second column of a file then print the first column of it in a ne fil if true java_girl Linux - Newbie 2 03-16-2012 04:50 AM
How-to cut specific text from cell and paste into new column ivn Linux - Newbie 5 12-17-2011 08:53 PM
cut column an edit data!!!!! jacky29 Programming 6 03-26-2011 05:53 AM
cut column ust Linux - Newbie 10 01-09-2008 03:28 AM


All times are GMT -5. The time now is 03:46 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 Google+: linuxquestions
Open Source Consulting | Domain Registration