require help about cut command


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers require help about cut command
# 1  
Old 09-03-2005
require help about cut command

hi, im trying to cut the file using cut command in unix . the problem is i want to input the chacter list from another file and then using the postioins specified in this file i want to cut another file.
for eg.
cut -c(here i want to use a list being read from a file) listdata(this is the file i want to cut)
can anyone help and tell me a suitable soution
# 2  
Old 09-03-2005
Your requirement is still not clear. Better you exemplify your problem.
# 3  
Old 09-05-2005
Try..
Code:
$ head file[12]
==> file1 <==
1,3-5

==> file2 <==
abcdefg

$ cut -c$(<file1) file2
acde

 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Cut command: can't make it cut fields

I'm a complete beginner in UNIX (and not a computer science student either), just undergoing a tutoring course. Trying to replicate the instructions on my own I directed output of the ls listing command (lists all files of my home directory ) to My_dir.tsv file (see the screenshot) to make use of... (9 Replies)
Discussion started by: scrutinizerix
9 Replies

2. UNIX for Dummies Questions & Answers

Cut pid from ps using cut command

hay i am trying to get JUST the PID from the ps command. my command line is: ps -ef | grep "mintty" | cut -d' ' -f2 but i get an empty line. i assume that the delimiter is not just one space character, but can't figure out what should i do in order to do that. i know i can use awk or cut... (8 Replies)
Discussion started by: ran ber
8 Replies

3. Shell Programming and Scripting

Require single command to start script in multiple servers

I have 9 servers, on each server a script with common name is available. I send a token file to all server from 1 particular server. so when a daemon job checks that token file is available then it triggers the script.. I want to know is there any command or script which I will run/execute on... (16 Replies)
Discussion started by: mirwasim
16 Replies

4. Shell Programming and Scripting

Cut Command error cut: Bad range

Hi Can anyone what I am doing wrong while using cut command. for f in *.log do logfilename=$f Log "Log file Name: $logfilename" logfile1=`basename $logfilename .log` flength=${#logfile1} Log "file length $flength" from_length=$(($flength - 15)) Log "from... (2 Replies)
Discussion started by: dgmm
2 Replies

5. UNIX for Dummies Questions & Answers

require detailed description for df -k command

Hi, I have used df -k always just to check the % of disk space left. Recently i discovered that the sum availabl space and used space is not equal to 1K-blocks. Can anyone explain me the reason for this difference. Thanks. (3 Replies)
Discussion started by: shooter
3 Replies

6. Shell Programming and Scripting

Require compare command to compare 4 files

I have four files, I need to compare these files together. As such i know "sdiff and comm" commands but these commands compare 2 files together. If I use sdiff command then i have to compare each file with other which will increase the codes. Please suggest if you know some commands whcih can... (6 Replies)
Discussion started by: nehashine
6 Replies

7. UNIX for Dummies Questions & Answers

require alternate command for lsof

Using lsof command i can find out which process-id is associated with the port. lsof -i :51000 . But as part of process i cant have lsof in the server. I am using sun solaris 8 and only kshell. Is there a way to find out which process is using the above port. as of now i am gettn port... (1 Reply)
Discussion started by: logic0
1 Replies

8. Solaris

Command to require OS info

Hi, I am new to UNIX environment. Can anybody tell me how can I check whether my OS is 32bit or 64bit? Regards, Malay Mary (4 Replies)
Discussion started by: malaymaru
4 Replies
Login or Register to Ask a Question