Here is a start that shows ParseWords:
Producing (on your data in file data1):
See perldoc Text::ParseWords on your system or obtain from cpan as noted. It takes care of the quoted strings, placing all the tokens in a list.
If the output is not what you desire, feel free to modify or adapt the code as necessary ... cheers, drl
I know in vi you can do
:%s/replaceme/withthis/
but if i want to find all lines say without a # at the begining and I want to put it in how would that command be formatted? I can't figure it out for the life of me.
#comment
blah1
hey1
grrr1
#comment
#blah1
#hey1
#grrr1 (5 Replies)
Can anyone tell me what is the purpose of a substitute variable in the unix programming language and give an example where it may be used?
Thanks! (0 Replies)
hi!
first i want to apologize for two things. my English and (possible) posting in the wrong sub forum (i couldn't find one that fits my question)
I am needing a script that can substitute rm.
the idea is that the operator can/must delete some folders and files from time to time, when the free... (2 Replies)
i'm writing a script that will extract and substitute a certain part of a data.
i'm having trouble with the substituting part ...
Here's my data looks like:
01/01/08-001-23:46:18-01/01/08-23:50:43
01/01/08-003-23:45:19-01/01/08-23:55:49
01/01/08-005-23:52:18-01/01/08-23:58:52
i want to... (6 Replies)
correct file names are:
*_0.txt
*_1.txt
incorrect file names are:
*_12.txt
*_0123.txt
*_04321.txt
all files that are incorrect need to replace the ending with *_1.txt
therefore need to create a loop to find the wrong files in a dir ->that dont end in _1.txt or _0.txt and then... (3 Replies)
My question is how would I substitute for ceratain number of occurences in a line? If this is my input
rjohns BFSTDBS01 Standard Silver NPRO30DINCR 2 Client
Is it possible to change the first 3 occurences of space " " to a comma? (7 Replies)
I usually use :
Code:
awk '{gsub(/xxx/,"yyy");print}'
to substitute xxx with yyy.
I have a problem substitute an expression like
Code:
x ' y
Because of the ( ' )
Any idea on how to get over this problem?
Thanks (2 Replies)
Hi there,
i am updating a file on UNIX and have many lines as per below :
listen:x:37:4:Network Admin:/usr/net/nls:
i would like to substitute from the :/usr to the end of the line.
so at the moment im using this :
:s/"\/$/ /g
but i get an error.can anyone help?
thank you (3 Replies)
I have to parse ASCII files, output the relevant data to a comma-delimited file and load it into a database table.
The specs for the file format have been recently updated and one section is causing problems. This is the original layout for that section.
... (2 Replies)
Hello All,
I have a shell script where with the lines below:
echo "${v_sd_dateTime},${RUN_QUEUE_SIZE},${LOAD_AVERAGE},${v_sd_load_list},${v_sd_thread_count_list}" >> ${v_sd_file}
Format of the output :
01/05/2005 08:00:00, RUN_QUEUE_SIZE, LOAD_AVG, CPU_PROD1, CPU_PROD2, THREADS_PROD1,... (1 Reply)
Discussion started by: Supriya_84
1 Replies
LEARN ABOUT MOJAVE
reportcrash
ReportCrash(8) BSD System Manager's Manual ReportCrash(8)NAME
ReportCrash -- Generates crash reports
SYNOPSIS
ReportCrash
DESCRIPTION
ReportCrash analyzes crashing processes and saves a crash report to disk. A crash report contains information that can help a developer
diagnose the cause of a crash. ReportCrash also records the identity of the crashing process and the location of the saved crash report in
the system.log and the ASL log database.
ReportCrash is invoked automatically by launchd when a crash is detected. For applications and other processes running in the per-user
launchd context, ReportCrash runs as a LaunchAgent and saves crash reports in the user's ~/Library/Logs/DiagnosticReports/ directory. For
daemons, other processes running in the system launchd context and other privileged processes, ReportCrash runs as a LaunchDaemon and saves
crash reports in the system's /Library/Logs/DiagnosticReports directory where they are only readable by admin users. If there are too many
crash reports saved for a particular process, older reports will automatically be removed in order to conserve disk space.
launchtl can be used to disable and re-enable crash reporting. To disable crash reporting:
launchctl unload -w /System/Library/LaunchAgents/com.apple.ReportCrash.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.ReportCrash.Root.plist
To re-enable crash reporting:
launchctl load -w /System/Library/LaunchAgents/com.apple.ReportCrash.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.ReportCrash.Root.plist
For application crashes (but not background process crashes) ReportCrash will display a dialog notifying the user that the application unex-
pectedly quit and offering to reopen the application or send the report to Apple. For developers, the behavior of this dialog can be
adjusted using /Developer/Applications/Utilities/CrashReporterPrefs.app which is installed as part of the developer tools.
Crash reports which are sent to Apple are submitted anonymously by the SubmitDiagInfo process. The reports are used by Apple to improve its
products. Users who need support should use http://www.apple.com/support or other authorized support channels. Developers who are ADC mem-
bers should report bugs using http://bugreporter.apple.com in order to allow for two way communication between Apple and the bug reporter.
More information about interpreting the contents of crash reports can be found in Technote 2123: https://developer.apple.com/library/con-
tent/technotes/tn2004/tn2123.html
SEE ALSO launchd(8), launchd.plist(8), launchctl(8), spindump(8), SubmitDiagInfo(8)Mac OS June 1, 2019 Mac OS