move file after validation The Next CEO of Stack OverflowShell script and crontab to capture file size, name and date in a CSV file and then send via email?Shell script to Capture the file name and size in csv file and add header on that fileMove the files from a folder and its subfolder to the same destination foldercannot move Directory not emptySearch a directory recursively for files listed in a csv, and copy them to another locationNeed to parse a csv file and it should store in variableMathematical calculation from different files inside directory using for loopShell Scripting for moving files from source to target dirScript needs to move one file to another directory; can't move it without its parent directory treevalidation of records
How to make a software documentation "officially" citable?
How do spells that require an ability check vs. the caster's spell save DC work?
Return the Closest Prime Number
Text adventure game code
Describing a person. What needs to be mentioned?
When did Lisp start using symbols for arithmetic?
How do I construct this japanese bowl?
How do scammers retract money, while you can’t?
How can I get through very long and very dry, but also very useful technical documents when learning a new tool?
What is the difference between "behavior" and "behaviour"?
Where to find order of arguments for default functions
Customer Requests (Sometimes) Drive Me Bonkers!
Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?
Visit to the USA with ESTA approved before trip to Iran
Why do remote companies require working in the US?
Implement the Thanos sorting algorithm
How to count occurrences of text in a file?
How do we know the LHC results are robust?
Science fiction novels about a solar system spanning civilisation where people change their bodies at will
Apart from "berlinern", do any other German dialects have a corresponding verb?
Trouble understanding the speech of overseas colleagues
Too much space between section and text in a twocolumn document
Does it take more energy to get to Venus or to Mars?
How do I go from 300 unfinished/half written blog posts, to published posts?
move file after validation
The Next CEO of Stack OverflowShell script and crontab to capture file size, name and date in a CSV file and then send via email?Shell script to Capture the file name and size in csv file and add header on that fileMove the files from a folder and its subfolder to the same destination foldercannot move Directory not emptySearch a directory recursively for files listed in a csv, and copy them to another locationNeed to parse a csv file and it should store in variableMathematical calculation from different files inside directory using for loopShell Scripting for moving files from source to target dirScript needs to move one file to another directory; can't move it without its parent directory treevalidation of records
Hi i have two files in the staging location.
- /projects/staging/mvn_file_data_001.csv, /projects/staging/mvn_file_data_002.csv,
/projects/staging/mvn_file_data_003.csv
/projects/staging/mvn_file_data_00n.csv- these files contains the complete data row wise.
corresponding to these files i have
- /projects/staging/loaded_mvn_file_001.call,
/projects/staging/loaded_mvn_file_002.call
/projects/staging/loaded_mvn_file_003.call
/projects/staging/loaded_mvn_file_00n.call
First i have to move the all the csv files to a temp location
temporary_csv =/projects/staging/temp_csv/
Second i have to move all the .call file to a temporary location
temporary_ok=/projects/staging/temp_ok
Now i have to compare these file which i have done using the if clause
now i have for loop for traversing the csv filehave defined variables
for i in temporary_csv - this will pick up all the file name with csv extension
count_csv = cat $i|wc -l
count_ok = i have found a way to fetch the count in ok files i dont remember right now.
the main issue is i have applied a an if clause
if [ $count_csv==$count_ok ] ; then
i want move the csv files back to staging location after validation
i.e /projects/staging/
else
move the file into bad directory
i.e /projects/bad
fi
done
now i have to take the validate this for multiple file is my above statement with the for loop correct for traversing the file and checking the record count or there is something else required.
shell-script
add a comment |
Hi i have two files in the staging location.
- /projects/staging/mvn_file_data_001.csv, /projects/staging/mvn_file_data_002.csv,
/projects/staging/mvn_file_data_003.csv
/projects/staging/mvn_file_data_00n.csv- these files contains the complete data row wise.
corresponding to these files i have
- /projects/staging/loaded_mvn_file_001.call,
/projects/staging/loaded_mvn_file_002.call
/projects/staging/loaded_mvn_file_003.call
/projects/staging/loaded_mvn_file_00n.call
First i have to move the all the csv files to a temp location
temporary_csv =/projects/staging/temp_csv/
Second i have to move all the .call file to a temporary location
temporary_ok=/projects/staging/temp_ok
Now i have to compare these file which i have done using the if clause
now i have for loop for traversing the csv filehave defined variables
for i in temporary_csv - this will pick up all the file name with csv extension
count_csv = cat $i|wc -l
count_ok = i have found a way to fetch the count in ok files i dont remember right now.
the main issue is i have applied a an if clause
if [ $count_csv==$count_ok ] ; then
i want move the csv files back to staging location after validation
i.e /projects/staging/
else
move the file into bad directory
i.e /projects/bad
fi
done
now i have to take the validate this for multiple file is my above statement with the for loop correct for traversing the file and checking the record count or there is something else required.
shell-script
What shell are you proposing to use for this? The syntax does not match any shell that I'm aware of. Are you asking about the general algorithm? Could you pleas clarify the actual question?
– Kusalananda♦
yesterday
add a comment |
Hi i have two files in the staging location.
- /projects/staging/mvn_file_data_001.csv, /projects/staging/mvn_file_data_002.csv,
/projects/staging/mvn_file_data_003.csv
/projects/staging/mvn_file_data_00n.csv- these files contains the complete data row wise.
corresponding to these files i have
- /projects/staging/loaded_mvn_file_001.call,
/projects/staging/loaded_mvn_file_002.call
/projects/staging/loaded_mvn_file_003.call
/projects/staging/loaded_mvn_file_00n.call
First i have to move the all the csv files to a temp location
temporary_csv =/projects/staging/temp_csv/
Second i have to move all the .call file to a temporary location
temporary_ok=/projects/staging/temp_ok
Now i have to compare these file which i have done using the if clause
now i have for loop for traversing the csv filehave defined variables
for i in temporary_csv - this will pick up all the file name with csv extension
count_csv = cat $i|wc -l
count_ok = i have found a way to fetch the count in ok files i dont remember right now.
the main issue is i have applied a an if clause
if [ $count_csv==$count_ok ] ; then
i want move the csv files back to staging location after validation
i.e /projects/staging/
else
move the file into bad directory
i.e /projects/bad
fi
done
now i have to take the validate this for multiple file is my above statement with the for loop correct for traversing the file and checking the record count or there is something else required.
shell-script
Hi i have two files in the staging location.
- /projects/staging/mvn_file_data_001.csv, /projects/staging/mvn_file_data_002.csv,
/projects/staging/mvn_file_data_003.csv
/projects/staging/mvn_file_data_00n.csv- these files contains the complete data row wise.
corresponding to these files i have
- /projects/staging/loaded_mvn_file_001.call,
/projects/staging/loaded_mvn_file_002.call
/projects/staging/loaded_mvn_file_003.call
/projects/staging/loaded_mvn_file_00n.call
First i have to move the all the csv files to a temp location
temporary_csv =/projects/staging/temp_csv/
Second i have to move all the .call file to a temporary location
temporary_ok=/projects/staging/temp_ok
Now i have to compare these file which i have done using the if clause
now i have for loop for traversing the csv filehave defined variables
for i in temporary_csv - this will pick up all the file name with csv extension
count_csv = cat $i|wc -l
count_ok = i have found a way to fetch the count in ok files i dont remember right now.
the main issue is i have applied a an if clause
if [ $count_csv==$count_ok ] ; then
i want move the csv files back to staging location after validation
i.e /projects/staging/
else
move the file into bad directory
i.e /projects/bad
fi
done
now i have to take the validate this for multiple file is my above statement with the for loop correct for traversing the file and checking the record count or there is something else required.
shell-script
shell-script
asked yesterday
Rahul RawatRahul Rawat
143
143
What shell are you proposing to use for this? The syntax does not match any shell that I'm aware of. Are you asking about the general algorithm? Could you pleas clarify the actual question?
– Kusalananda♦
yesterday
add a comment |
What shell are you proposing to use for this? The syntax does not match any shell that I'm aware of. Are you asking about the general algorithm? Could you pleas clarify the actual question?
– Kusalananda♦
yesterday
What shell are you proposing to use for this? The syntax does not match any shell that I'm aware of. Are you asking about the general algorithm? Could you pleas clarify the actual question?
– Kusalananda♦
yesterday
What shell are you proposing to use for this? The syntax does not match any shell that I'm aware of. Are you asking about the general algorithm? Could you pleas clarify the actual question?
– Kusalananda♦
yesterday
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f508872%2fmove-file-after-validation%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f508872%2fmove-file-after-validation%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What shell are you proposing to use for this? The syntax does not match any shell that I'm aware of. Are you asking about the general algorithm? Could you pleas clarify the actual question?
– Kusalananda♦
yesterday