Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split a column #311

Open
2803media opened this issue Jan 25, 2023 · 0 comments
Open

Split a column #311

2803media opened this issue Jan 25, 2023 · 0 comments

Comments

@2803media
Copy link

Hi I have the following awk command and I try to convert it to xsv but failed to split a string from a column with the tool

awk -F';' -vFPAT='([^;]*)|("[^"]*")' 'FNR==1{print $1","$2","$3","$4","$5","$6","$7","$8","$9","$10","$11","$12","$13","$14","$15","$16","$17","$18","$19","$20","$21","$22","$23","$24","$25","$26","$27","$28",""DEPET" } FNR>1{gsub(/,|"/, "", $23); if (substr ($13, 1,2) == "97" || substr ($13, 1,2) == "98") a = substr ($13, 1,3); else a = substr ($13, 1,2); print $1","$2","$3","$4","$5","$6","$7","$8","$9","$10","$11","$12","$13","$14","$15","$16","$17","$18","$19","$20","$21","$22","$23","$24","$25","$26","$27","$28","'a' }' test.csv

Do you know if it's possible to do a thing like that with xsv?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant