Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

separate a file using a tag

 cat file.txt | awk -v RS="your_tag" '{ print $0 > "structure" NR }'
 
 this tend to create empty files / useless files after the final tag, so remove them as below 
 $5==0 $5 is file size column, 0 is to empty sometime it may be 2,3 kb, add file size accrodingly 
 
 ls -ltr structure* | awk '{if($5==0) system("rm "$9)}' 
Comment

PREVIOUS NEXT
Code Example
Shell :: sudo add-apt-repository ppa:diodon-team/stable 
Shell :: linux less command color 
Shell :: head in windows console 
Shell :: ${env:windir} user profile list environment variables 
Shell :: ubuntu startup run as daemon service 
Shell :: what is the bat code to the print hello world 
Shell :: chekkout of branch without committing changes 
Shell :: install tripwire in linux 
Shell :: bloquear /var/lib/apt/lists 
Shell :: bash check return value of function 
Shell :: powershell file already exists 
Shell :: chmod rwx for all users 
Shell :: Invariant Violation: requireNativeComponent: "RCTPdf" was not found in the UIManager. 
Shell :: what is installation testing 
Shell :: how to install celluloid in kali 
Shell :: passing variables into array 
Shell :: rename a file in terminal linux 
Shell :: how to install app from android phone programmatically 
Shell :: free space terminal ubuntu 
Shell :: push local file to remote forcefully 
Shell :: npap find ip addresses in netowrk 
Shell :: add bash as defult on arch 
Shell :: make folder public digital ocean bucket 
Shell :: linux xcursor 
Shell :: shell script call another script with parameters 
Shell :: another command in awk field 
Shell :: ssh how to start a script out of the session 
Shell :: iptables linux 80 and 443 open 
Shell :: powershell remove part of string 
Shell :: how to change line in slack 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =