Open folder
Open the project folder in Adhoc Kit.
You have a CSV export with many rows and need a total for one column. Adhoc Kit writes an awk script, runs it, and shows the result.
Open the project folder in Adhoc Kit.
Create report.awk with the logic.
Execute awk -f report.awk data.csv in WSL or over SSH.
Review the output and exit code.
report.awksavedawk -f report.awk data.csvexit 0report.awkoktotal1 match# report.awk
# Calculate total for field 3
BEGIN { FS = "," }
NR == 1 { next }
{
total += $3
count++
}
END {
printf "Rows: %d\n", count
printf "Total: %.2f\n", total
}This short program skips the header line, adds the third field to a running total, and prints the final count and sum when the file ends. Note that a plain comma separator breaks on CSV fields that contain quoted commas.
Adhoc Kit uses write_file to create report.awk in your working folder and the agent runs the command in the Shell tool to process your data. You see the output. The program skips the first line using NR == 1. It adds the third field to the total variable for calculation. The END block prints the results for your review and analysis. You can ask how to perform an awk inplace update just one field in your workflow. Check the exit code to confirm that awk ran successfully. Verify the total against the data for accuracy and correctness.
The Shell tool returns the printed text so you see the row count and the total sum from the agent clearly, and Adhoc Kit records this action for your review. You approve. You can use this method for any CSV file that you need to process. You split string in awk with delimiter to handle complex data structures. The regex tutorial helps you understand field splitting logic deeply. You test the pattern on sample lines first to verify correctness. Adhoc Kit runs the command again if you change the script logic. You use Ask first mode before proceeding with the update.