07-02-2015
Hi rabtte1
The code from Scrutinizer works for the problem I posted.
- Yes there are more lines in the file, but I want the number just from the 2nd line.
- I want the number before the | delimiter
- There are about 100 files
- I tried python but couldn't solve the issue
I have to drop the numbers before *.txt as well
Regards
Vishal
Last edited by rbatte1; 07-02-2015 at 11:33 AM..
Reason: Replaced text numbered list with LIST=1 tags. Added ICODE tags for pipe symbol
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am running a script remotely to another client. after it runs it places the file in /tmp. I need the file in /tmp to be renamed to the local hostname. but when i set the variable it names the file to my local hostname. how do i fix that (4 Replies)
Discussion started by: deaconf19
4 Replies
2. Shell Programming and Scripting
Hi All,
I am looking for a Unix shell script for file naming such that the file names itself as KARAN0001.
The 4 digit sequence number must start at 0001 and end at 9999.
After 9999 is reached, the number must reset to 0001.
Can anyone please help me with that.
Thanks & Regards
... (2 Replies)
Discussion started by: karansachdeva
2 Replies
3. Shell Programming and Scripting
Hi,
I want to create a file named 'abc(+1)' and append the data of file 'abc' to it. But getting error as unexpected'(' when i tried to use the following command.
cat abc > abc(+1)
Is there any other way to include brackets along with +1 in the file name?
TIA. (3 Replies)
Discussion started by: vimalr
3 Replies
4. Shell Programming and Scripting
hi all,
Please advise at what circumstance those file will become
-rwxr-xr-x 1 psa psa 1969088 Aug 18 2006 #libaa.sl
-rwx------ 1 psa psa 2166784 Jul 25 2006 #libcrypto.sl.0.9.7
-rwx------ 1 psa psa 904040 Jul 25 2006 #libxxx.sl
-rwx------ 1 psa ... (2 Replies)
Discussion started by: rauphelhunter
2 Replies
5. Shell Programming and Scripting
Hi,
I need some help!
I have a file in which i im splitting into 20 different files each called
model_001.in
model_002.in
etc...
i would like to make directory for each file using only the name and not the extension so that the directory names are
model_001
model_002
etc.
... (8 Replies)
Discussion started by: olifu02
8 Replies
6. Shell Programming and Scripting
Hi All,
I have a rather stange set of requirements that I'm hoping someone here could help me with. We receive a file that is actually a concatenation of 4 files (don't believe this would change, but ideally the solution would handle n files).
The super-file looks like:... (7 Replies)
Discussion started by: Leedor
7 Replies
7. Shell Programming and Scripting
Hi,
su - oracle<<EOC
export PATH=${PATH}:${ORACLE_HOME}/bin
exit
EOC
set `sqlplus -S $user_name/$password@$tns<<EOS
set head off
select min(time),max(time) from products;
exit;
EOS`
var1=$1
var2=$2
su - oracle -c "exp user/pass@localdb... (7 Replies)
Discussion started by: milink
7 Replies
8. Red Hat
Hi,
I am installing a new RHEL 5 application server containing JBOSS along with other specific 3rd party applications. I know that this usually gets installed in /opt but I was thinking of installing these on a new separtate lv / file system instead.
i.e.
/<my_new_FS_name>
rather than... (6 Replies)
Discussion started by: Duffs22
6 Replies
9. Shell Programming and Scripting
#!/bin/bash
while read inputline
do
what="$inputline"
echo $what;
if ;
then
exit
fi
$reextend $what
$print ls -a
done
this is my code i am trying to change all of the file types of a certain directory to another file type but im not all the way there can someone help please (3 Replies)
Discussion started by: domdom110
3 Replies
10. UNIX for Dummies Questions & Answers
Hi all,
I have a problem with file naming in linux. I have to create a file named like 11/22.csv but shell displays error: no such file or dir. Problem is / character in the file name. I searched unix linux naming concepts and it's restricted in OS. Please tell me if there's any other chance?
OS... (3 Replies)
Discussion started by: sembii
3 Replies
CUT(1) User Commands CUT(1)
NAME
cut - remove sections from each line of files
SYNOPSIS
cut OPTION... [FILE]...
DESCRIPTION
Print selected parts of lines from each FILE to standard output.
Mandatory arguments to long options are mandatory for short options too.
-b, --bytes=LIST
select only these bytes
-c, --characters=LIST
select only these characters
-d, --delimiter=DELIM
use DELIM instead of TAB for field delimiter
-f, --fields=LIST
select only these fields; also print any line that contains no delimiter character, unless the -s option is specified
-n with -b: don't split multibyte characters
--complement
complement the set of selected bytes, characters or fields
-s, --only-delimited
do not print lines not containing delimiters
--output-delimiter=STRING
use STRING as the output delimiter the default is to use the input delimiter
--help display this help and exit
--version
output version information and exit
Use one, and only one of -b, -c or -f. Each LIST is made up of one range, or many ranges separated by commas. Selected input is written
in the same order that it is read, and is written exactly once. Each range is one of:
N N'th byte, character or field, counted from 1
N- from N'th byte, character or field, to end of line
N-M from N'th to M'th (included) byte, character or field
-M from first to M'th (included) byte, character or field
With no FILE, or when FILE is -, read standard input.
GNU coreutils online help: <http://www.gnu.org/software/coreutils/> Report cut translation bugs to <http://translationproject.org/team/>
AUTHOR
Written by David M. Ihnat, David MacKenzie, and Jim Meyering.
COPYRIGHT
Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO
The full documentation for cut is maintained as a Texinfo manual. If the info and cut programs are properly installed at your site, the
command
info coreutils 'cut invocation'
should give you access to the complete manual.
GNU coreutils 8.22 June 2014 CUT(1)