finding the strings beween 2 characters "/" & "/" in .txt file
Hi all.
I have a .txt file that I need to sort it
My file is like: What I need is to first find the string between 2nd and 3rd "/" that here means
in line 1:jtagc , 2:io_toplevel 3:external_tdrs and then make another .txt file with that name(the one that is found) and put all the same cases in that file and remove from main list
So at the end create for example 3files :
1-jtagc.txt 2-io_toplevel 3-external_tdrs
(Text file is more than 50K lines, so the code should be capable to search line by line)
Thanks in advance
And sorry for my long question
Last edited by Scrutinizer; 10-25-2012 at 08:27 AM..
Reason: code tags
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
Dear friends, following is the output of a script from which I want to remove spaces and new-line characters.
Example:-
Line1 abcdefghijklmnopqrstuvwxyz
Line2 mnopqrstuvwxyzabcdefghijkl
Line3 opqrstuvwxyzabcdefdefg
Here in above example, at every starting line there is a “tab” &... (4 Replies)
Hi,
I've modified the syslogd source to include a thread that will keep track of a timer(or a timer thread). My intention is to check the file size of /var/log/messages in every one minute & if the size is more than 128KB, do a echo " " > /var/log/messages, so that the file size will be set... (7 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Basically I want to shorten URLs on my html pasting site (pasteht.ml), by using "/~a1Pha" instead of "/paste/a1Pha". The ID is 5 numbers and letters, both cases.
For example:
/~idnum serves /paste/idnum.htm
/=idnum serves /paste/idnum.htm
/paste/idnum redirects to /~idnum (to update any old... (0 Replies)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Hi 2 all,
i have had AIX 7.2
:/# /usr/IBMAHS/bin/apachectl -v
Server version: Apache/2.4.12 (Unix)
Server built: May 25 2015 04:58:27
:/#:/# /usr/IBMAHS/bin/apachectl -M
Loaded Modules:
core_module (static)
so_module (static)
http_module (static)
mpm_worker_module (static)
... (3 Replies)
Discussion started by: penchev
3 Replies
LEARN ABOUT PHP
truncate
TRUNCATE(1) User Commands TRUNCATE(1)NAME
truncate - shrink or extend the size of a file to the specified size
SYNOPSIS
truncate OPTION... FILE...
DESCRIPTION
Shrink or extend the size of each FILE to the specified size
A FILE argument that does not exist is created.
If a FILE is larger than the specified size, the extra data is lost. If a FILE is shorter, it is extended and the extended part (hole)
reads as zero bytes.
Mandatory arguments to long options are mandatory for short options too.
-c, --no-create
do not create any files
-o, --io-blocks
treat SIZE as number of IO blocks instead of bytes
-r, --reference=RFILE
base size on RFILE
-s, --size=SIZE
set or adjust the file size by SIZE bytes
--help display this help and exit
--version
output version information and exit
The SIZE argument is an integer and optional unit (example: 10K is 10*1024). Units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (pow-
ers of 1000).
SIZE may also be prefixed by one of the following modifying characters: '+' extend by, '-' reduce by, '<' at most, '>' at least, '/' round
down to multiple of, '%' round up to multiple of.
AUTHOR
Written by Padraig Brady.
REPORTING BUGS
GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
Report truncate translation bugs to <http://translationproject.org/team/>
COPYRIGHT
Copyright (C) 2017 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 dd(1), truncate(2), ftruncate(2)
Full documentation at: <http://www.gnu.org/software/coreutils/truncate>
or available locally via: info '(coreutils) truncate invocation'
GNU coreutils 8.28 January 2018 TRUNCATE(1)