(both with and without the quotes around ${arr2[@]}) prints nothing. Manage Settings Why does Paul interchange the armour in Ephesians 6 and 1 Thessalonians 5? How to turn off zsh save/restore session in Terminal.app. For some reason column doesn't work for me. We changed all commas in fields with semicolons and all embedded quotation marks with apostrophes and saved our changes. RELATED: 9 Bash Script Examples to Get You Started on Linux. You could use the bash builtin mapfile (aka readarray) with a callback that uses parameter expansion to trim the longest trailing substring starting with two spaces: mapfile -c 1 -C 'f () { field_one [$1]="$ {2%% *}"; }; f' < mytxt Ex. My data is a simple array of strings, like `values=(one two three four five)'. Does contemporary usage of "neithernor" for more than two options originate in the US, Process of finding limits for multivariable functions, Mike Sipser and Wikipedia seem to disagree on Chomsky's normal form. Loop (for each) over an array in JavaScript, PyQGIS: run two native processing tools in a for loop. Suppose we need to extract the first and last names, job titles, and email addresses from each record, but we want to have the name order as last name, first name. All we need to do is put the field names or numbers in the order we want them. Sci-fi episode where children were actually adults, New external SSD acting up, no eject option. file_in word1 word2 word3 word4 then, i want save the column in a bash array in order to get: pre { overflow:scroll; mar | The UNIX and Linux Forums . The four characters starting from 20 position is repeating in several. Making statements based on opinion; back them up with references or personal experience. That field needs to have quotation marks " wrapped around it. In shells that support it (ksh, zsh, bash) you can use <( ) to replace the here-string: With differences: <( ) is able to emit NUL bytes while a here-string might remove (or emit a warning) the NULs. What should I do when an employer issues a check and requests my personal banking access details? Once were happy we have the data the way we want it we can remove the csvlook from the command chain, and create a new CSV file by redirecting the output into a file. For old shells without arrays (using positional arguments, the only quasi-array): Here-string Look at the source, there they are. Heres the top of our file: The first line holds the field names as comma-separated values. Tried all three techniques, roughly same result. Your data is generated using realistic dummy values and downloaded to your computer. Bash Read a file (data stream, variable) line-by-line (and/or field-by-field)? Is a copyright claim diminished by an owner's refusal to publish? The output is saved on a new line each time a field has been found. How to add double quotes around string and number pattern? By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. I have one question: You suggested a here-string (, Does piping also use a temporary file? Make the script executable using the chmod command. If you wish to see which version of Bash you are currently running, you can use the following command: If your version for Bash is less than 4.0, you can skip down to the next method, as readarray will not work for you. in bash script. But the result is not perfect: depending on the strings lenght, there's sometimes holes in the columns. Learn more about Stack Overflow the company, and our products. Linux is a registered trademark of Linus Torvalds. Making statements based on opinion; back them up with references or personal experience. Use a while read loop to parse the input into two variables, then set an array with them. The -c (column) option can be used with field names or column numbers, or a mix of both. Can I ask for a refund or credit next year? Basically, it pipes each line into printf, which left-aligns it into a 24-character-wide block of whitespace, which is then piped into sed. will do what you want (starting with index 0 however). Parsing CSV Files Having Line Breaks and Commas Within Records Losing my brain with column not displaying properly formatted columns, here's more info: Notice the first two digits as an index and the last one indicating the string length for readability. What is the etymology of the term space-time? What are possible reasons a sound may be continually clicking (low amplitude, no sudden changes in amplitude), New Home Construction Electrical Schematic. Theres quite a bit packed into our little script. Locate the CSV file that you want to open. Empty lines from the input are ignored unless the -e option is used. How to extract a file content into array in Bash line by line. Alternative ways to code something like a table within a table? Why are parallel perfect intervals avoided in part writing when they are so common in scores? Copy this script into an editor, and save it to a file called field.sh.. How to determine chain length on a Brompton? How to concatenate string variables in Bash. Asking for help, clarification, or responding to other answers. This is then redirected into the while loop, providing the text that the read command will parse. rev2023.4.17.43393. By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. New Home Construction Electrical Schematic. After that, we will look into a more general approach for reading a file into a Bash array. We and our partners use cookies to Store and/or access information on a device. Your simple Bash parsers can then cope with the Bash-friendly CSV. The shellcheck page will give you the rationale why this is considered best practice. ( It automatically flows to next line too ). (NOT interested in AI answers, please), What to do during Summer? Could a torque converter be used to couple a prop to a higher RPM piston engine? What to do during Summer? Learn more about Stack Overflow the company, and our products. Share CSV files are human-readable. Not the answer you're looking for? I knew that. Real polynomials that go to infinity in all directions: how fast do they grow? So you can check for duplicates when more data arrives? What could a smart phone still do or not do and what would the screen display be if it was sent back in time 30 years to 1993? Also not too effective but OP preferred, Loop over columns and store values to associative arrays, The philosopher who believes in Web Assembly, Improving the copy in the close modal and post notices - 2023 edition, New blog post from our CEO Prashanth: Community is the future of AI, awk array using number as value did not work, Loop over associative arrays by substring, summing two matrixes each one in a different file, Calculate interval if value in column changes, how to evaluate number between a range of numbers using different variables in bash, Counting values between two values defined by two columns, Sort groups of rows where field values are the same in certain columns, Bash Script total sum of a column when another column equals to an input value, sum column values considering entry in other column. This is what we get when we run the script. Weve added the cut command into the process substitution clause. To subscribe to this RSS feed, copy and paste this URL into your RSS reader. Browse other questions tagged. For a calculation I then need to sum up 2nd column's values for a particular interval till the end of the file, e.g. The best answers are voted up and rise to the top, Not the answer you're looking for? Hi, I got a text file which I used "textscan" to read and convert into an array called dat.Now I want to make a loop by reading each column c (starting from column 2 till 301), and then inside that loop I need another loop that reads each row r (from row 1 to 52561) of a column and when reading that value if it is lower than the value of the 12th row (r+12) ahead of that one, then it replaces . @Arko: Your data lines up perfectly for me using the command you supplied. Can we create two different filesystems on a single partition? Site design / logo 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA. Thanks again :) Answer in. print all array elements (with space as separators), replace spaces with '+', send to bc -l for doing the actual math operation. In the mean time, i found an other "way" to do it See my own answer. 6. In this case, you can use the read command to read each line in entirety, and then extract necessary column data by using bash's built-in regular expression. Peanut butter and Jelly sandwich - adapted to ingredients from the UK, Storing configuration directly in the executable, with no external config files. Making statements based on opinion; back them up with references or personal experience. Reading columns from a text file and to make an array for each column. Thanks for contributing an answer to Stack Overflow! Extract file contents into array using Bash, The philosopher who believes in Web Assembly, Improving the copy in the close modal and post notices - 2023 edition, New blog post from our CEO Prashanth: Community is the future of AI. Well lend a hand. Notices Welcome to LinuxQuestions.org, a friendly and active Linux Community. Browse other questions tagged. Xmodulo 2021 About Write for Us Feed Powered by DigitalOcean, Creative Commons Attribution-ShareAlike 3.0 Unported License. The readarray is a function that comes with Bash 4.0. In text file every line include some number of words. By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. Loop through an array of strings in Bash? How can I make inferences about individuals from aggregated data? Can I ask for a refund or credit next year? Start here for a quick overview of the site, Detailed answers to any questions you might have, Discuss the workings and policies of this site. You can also just update your bash with homebrew, build bash yourself, etc. When Tom Bombadil made the One Ring disappear, did he put it into a place that only he had access to? How to determine chain length on a Brompton? One common task in day-to-day shell scripting jobs is to read data line by line from a file, parse the data, and process it. To subscribe to this RSS feed, copy and paste this URL into your RSS reader. Use readarray in bash[a] (a.k.a mapfile) to avoid the loop: [a]In ksh you will need to use read -A, which clears the variable before use, but needs some "magic" to split on newlines and read the whole input at once. How do I tell if a file does not exist in Bash? To print out the entire array, use the following syntax: The syntax for the general method is as follows: Reading this array will have similar syntax as shown in the previous example: The above Bash line will display the contents in the index 1 of the array. So use it only if your file is free of this kind of scenario. Specify the options to divide the text in the file into columns. Thanks for contributing an answer to Unix & Linux Stack Exchange! I want to split words to array from every line. Just starting out and have a question? Hi I have a file with just one column, and i'd like to save it in a bash array. function read_file_into_array (file, array ,status, record, count ) { count = 0; while (1) { status = getline record < file if (status == -1) { print "Failed to read file " file; exit 1; } if (status == 0) break; array [++count] = record; } close (file); return count } Example ( AWK code): Code: The mapfile command addressed my needs exactly! By submitting your email, you agree to the Terms of Use and Privacy Policy. How do I declare and initialize an array in Java? This tutorial covers a few methods for reading lines from a file and loading them into an array using Bash. Notice the printf spec of %-*s for left justified colums and right would drop the '-'. with bash: arr1= ( $ ( cut -d' ' -f1 file ) ) arr2= ( $ ( cut -d' ' -f2 file ) ) i.e. Why hasn't the Attorney General investigated Justice Thomas? If not, you don't need an associative array, just normal indexed. I am not so familiar with bash scripting and would appreciate your help here. That's exactly what i was looking for. (Tenured faculty). As the name suggests, a comma , is used to separate each field of dataorvaluefrom its neighbors. What information do I need to ensure I kill the same process, not one spawned much later with the same PID? Put someone on the same pedestal as another, Does contemporary usage of "neithernor" for more than two options originate in the US. Copy $IFS, set $IFS to newline, slurp file into array and reset $IFS back again. Learn more about Stack Overflow the company, and our products. 1 Answer Sorted by: 28 You can use the read shell builtin: while IFS=" " read -r value1 value2 remainder do . Finding and replacing these with a single apostrophe ' will replace the double quotation marks in the CSV file. Shell script not reading the file as expected. Continue with Recommended Cookies. How can I make inferences about individuals from aggregated data? Browse other questions tagged. The text that the read command parses is stored in a set of variables named after the CSV fields. I needed to output columns without using column. How to turn off zsh save/restore session in Terminal.app, What are possible reasons a sound may be continually clicking (low amplitude, no sudden changes in amplitude). Dystopian Science Fiction story about virtual reality (called being hooked-up) from the 1960's-70's, What PHILOSOPHERS understand for intelligence? With readarray you read the single file and you put in a 1D vector. It is an HTML feature, multiple white spaces are rendered as one by default. His writing has been published by howtogeek.com, cloudsavvyit.com, itenterpriser.com, and opensource.com. This is subject to pathname expansion (and will discard empty lines)don't use. Process of finding limits for multivariable functions. column seems to struggle with some data in a single-column input being narrower than a tabstop (8 characters). The best answers are voted up and rise to the top, Not the answer you're looking for? When you did: arr1= ($ (git . )) To subscribe to this RSS feed, copy and paste this URL into your RSS reader. I made a shim for mapfile if you want to use mapfile on bash < 4.x for whatever reason. the "command expansion" is unquoted, and so: it is subject to shell split and glob. Site design / logo 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA. Can members of the media be held legally responsible for leaking documents they never agreed to keep secret? A here-string adds a trailing newline by default. Alternative ways to code something like a table within a table? In this case, though, you need to specify the chosen delimeter in IFS variable. To learn more, see our tips on writing great answers. You Might Not Get a Tax Credit on Some EVs, This Switch Dock Can Charge Four Joy-Cons, Use Nearby Share On Your Mac With This Tool, Spotify Shut Down the Wordle Clone It Bought, Outlook Is Adding a Splash of Personalization, Audeze Filter Bluetooth Speakerphone Review, EZQuest USB-C Multimedia 10-in-1 Hub Review, Incogni Personal Information Removal Review, Kizik Roamer Review: My New Go-To Sneakers, Grelife 24in Oscillating Space Heater Review: Comfort and Functionality Combined, Monster Blaster 3.0 Portable Speaker Review: Big Design, Undeniably Good Audio, Level Lock+ Review: One of the Best Smart Locks for Apple HomeKit. By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. Why does Paul interchange the armour in Ephesians 6 and 1 Thessalonians 5? Usually you won't need that. The IFS is an environment variable. This method should work for all versions of Bash greater than 4.0. Note that filename expansion still occurs; e.g. Also note that "${#arr}" is the number of set element in the array, not necessarily the last index. When you type read without any additional options, you will need to hit enter to start the capture. Content Discovery initiative 4/13 update: Related questions using a Machine How to output a bash array into multiple columns of numbered items. Can you tell why you want that anyway? If the file has a *.csv extension, select the file. This proves the problem isnt the CSV. Can I use money transfer services to pick cash up for myself (from USA to Vietnam)? Connect and share knowledge within a single location that is structured and easy to search. The best answers are voted up and rise to the top, Not the answer you're looking for? Shell script :: Reading a column from file & store it in array [closed], The philosopher who believes in Web Assembly, Improving the copy in the close modal and post notices - 2023 edition, New blog post from our CEO Prashanth: Community is the future of AI, Shell command to monitor changes in a file, Finding the Public IP address in a shell script, control a bash script with variables from an external file, Echo each shell script command with a timestamp. First, we will see the readarray method. My question is this: How can I read in these values into an array? An alternative approachespecially if youre working to a deadline of some sortemploys two different strategies. @Hugues : yap, filename expansion still occurs. bash does not distinguish data types in variables, the first index number for any array is 0. The -f (field) option tells cut we want fields one, four, six, and seven. If each line contains multiple fields, read can read individual fields and store them into supplied variables. You could just do this: But if you want to, you can make read give you an array, too: Thanks for contributing an answer to Stack Overflow! the following: 123 456 789 Now I'd like to use the grep command to look for the results in another text file using the array, so print out lines where "123", "456" or "789" appear. I have another query..if you dont mind.I added this condition inside the loop: sed 's/$value1/$value2/g' circos.conf Is it correct to work ? One can read comma separated CSV file using GUI app too. the "command expansion" is unquoted, and so: it is subject to shell split and glob. into a new array entry. To make the output prettier we can feed it through csvlook . A typical log file is not as structured as CSV files, and may not use a fixed delimiter character, nor use a fixed number of columns. Also note that we can check if a particular column is empty or not by using -z operator. The first method is to use the read command and a while loop in a Bash script. You could replace them with nothing so that they vanish, or with a character that wont affect the CSV parsing, like a semi-colon ; for example. You need to use read to split on newlines but not with a pipe. The -n +2 (line number) option tells tail to start reading at line number two. How to provide the file name in this syntax ? The field content is displayed to show what the field contents represent, not as theyre stored in the CSV file. It only takes a minute to sign up. Despite bash 4 being released in 2009, @ericslaw's comment remains relevant because many machines still ship with bash 3.x (and will not upgrade, so long as bash is released under GPLv3). (Set up the link in the opposite direction, since we have a better accepted answer here than we have there). This action is called parsing. You can use the find and replace function to search for commas. What's the best way to do so? This shell script will produce the following output. How to trim whitespace from a Bash variable? One is to use a purpose-designed tool to manipulate and extract your data. Click OK. Bash 4 is about 5 years old now. Find centralized, trusted content and collaborate around the technologies you use most. Making statements based on opinion; back them up with references or personal experience. Read columns from file into separate variables, The philosopher who believes in Web Assembly, Improving the copy in the close modal and post notices - 2023 edition, New blog post from our CEO Prashanth: Community is the future of AI. We can solve the problem using the read command: IFS=$ '\n' read -r -d '' -a my_array < < ( COMMAND && printf '\0' ) Let's test it and see if it will work on different cases: Tools like awk will let you get close, but there are always edge cases and exceptions that slip through. How can I detect when a signal becomes noisy? So the shim can come in handy. It uses the existing mapfile command if you are on bash >= 4.x. What does Canada immigration officer mean by "I'm not satisfied that you will leave Canada based on your purpose of visit"? UNIX is a registered trademark of The Open Group. readarray Now let's see some examples of read command to understand how you can use it in different situations. They could just as easily have been named field1, field2, field7 , but meaningful names make life easier. Is there a way to get the date range from a csv file? If you open a CSV file in LibreOffice Calc, each field will be placed in a cell. Withdrawing a paper after acceptance modulo revisions? Thank you so much for your clear answer. Using printf within a for-loop to pad values to 8 characters seems to do the trick: Here are a couple of techniques that can be used with Johnsyweb's answer so you can do your output without a loop: It may look overkill, but i came up with my own solution. Connect and share knowledge within a single location that is structured and easy to search. Thanks! but it didn't work, it extracts the whole lines into [0] index element, You can use a loop to read each line of your file and put it into the array. When Tom Bombadil made the One Ring disappear, did he put it into a place that only he had access to? Linux is a registered trademark of Linus Torvalds. How do I set a variable to the output of a command in Bash? Why is Noether's theorem not guaranteed by calculus? (Tenured faculty). All the other things from the bash manual work, too, of course. To learn more, see our tips on writing great answers. Upgrade. If you wish to see which version of Bash you are currently running, you can use the following command: echo $ {Bash_VERSION} Start here for a quick overview of the site, Detailed answers to any questions you might have, Discuss the workings and policies of this site. Connect and share knowledge within a single location that is structured and easy to search. We specify that a comma should be used as the internal field separator, with the IFS="," statement. Connect and share knowledge within a single location that is structured and easy to search. The shell's default IFS (inter-field-seperator) consisting of white space characters will be used to split each line into its component fields. The N command reads the next line into the current buffer, and s/\n// removes the line break. What could a smart phone still do or not do and what would the screen display be if it was sent back in time 30 years to 1993? What does Canada immigration officer mean by "I'm not satisfied that you will leave Canada based on your purpose of visit"? Greater than 4.0 s for left justified colums and right would drop the '-.! This case, though, you agree to the terms of use and privacy policy right would drop '-. Visit '' the '- ' to your computer in several values= ( one three. Youre working to a higher RPM piston engine in fields with semicolons and all quotation... Understand how you can use the find and replace function to search for commas polynomials go. Marks in the CSV file from a CSV file that you will Canada... Help here being narrower than a tabstop ( 8 characters ) prop to a file into in... Also note that we can check for duplicates when more data arrives reading columns from a bash read column from file into array file using app... Working to a deadline of some sortemploys two different filesystems on a.! By submitting your email, you agree to the output prettier we check... ) over an array with them different filesystems on a Brompton simple Bash parsers can cope... As comma-separated bash read column from file into array.csv extension, select the file name in this syntax over an array and these., multiple white spaces are rendered as one by default issues a check and requests personal... Common in scores to Store and/or access information on a Brompton a Brompton command! Around the technologies you use most columns from a CSV file using GUI app too an! Spec of % - * s for left justified colums and right would drop the '. Range from a file content into array and reset $ IFS to newline, slurp file into a more approach... And s/\n// removes the line break manage Settings why does Paul interchange the armour in Ephesians 6 and 1 5! To make an array using bash read column from file into array with field names or numbers in the order we want them what does immigration. Some Examples of read command and a while read loop to parse the input are ignored the! Shim for mapfile if you open a CSV file I declare and initialize array... How to extract a file does not exist in Bash, itenterpriser.com, and our products individual. Commons Attribution-ShareAlike 3.0 Unported License and reset $ bash read column from file into array to newline, slurp file into and! Have a better accepted answer here than we have a better accepted answer here we. Issues a check and requests my personal banking access details the capture double! Claim diminished by an owner 's refusal to publish, though, you agree to terms! Asking for help, clarification, or responding to other answers that a comma, is.. Rss reader the columns line holds the field names or numbers in columns! Part writing when they are in a 1D vector so you can check a. Expansion & quot ; command expansion '' is unquoted, and so: is... Be placed in a Bash array into multiple columns of numbered items a prop to a RPM. Or credit next year line holds the field names or numbers in the CSV fields will be placed a. Number of words script into an array with them CC BY-SA through.. Of the open Group -f ( field ) option tells tail to start the capture Bash! For contributing an answer to Unix & Linux Stack Exchange Inc ; user contributions licensed under CC BY-SA use to. Registered trademark of the open Group can then cope with the Bash-friendly CSV does Paul interchange armour! Some reason column does n't work for me into the process substitution clause and rise to the top of file... N'T use the chosen delimeter in IFS variable -e option is used to separate each field of dataorvaluefrom its.. All commas in fields with semicolons and all embedded quotation marks `` wrapped around it privacy policy into! Delimeter in IFS variable an owner 's refusal to publish being hooked-up ) from the input are ignored the... Drop the '- ' names as comma-separated values options, you agree our... Linux Community loop in a 1D vector old now so use it only if your file is free this! You read the single file and loading them into supplied variables there they are so common in scores Store... A function that comes with Bash scripting and would appreciate your help here transfer services to pick up! The mean time, I found an other `` way '' to do it see my own answer arrays! Of read command will parse right would drop the '- ' by owner. Command into the current buffer, and our products the text bash read column from file into array the CSV file using app. Processing tools in a for loop up perfectly for me LibreOffice Calc, field! On Bash > = 4.x Bash-friendly CSV IFS back again an other `` way '' to is... Redirected into the while loop, providing the text that the read command to understand how you check. Sortemploys two different filesystems on a device all embedded quotation marks in the CSV fields this tutorial covers a methods., with the Bash-friendly CSV New external SSD acting up, no eject option off zsh session! Privacy policy and cookie policy first method is to use mapfile on Bash > = 4.x a place only! Media be held legally responsible for leaking documents they never agreed to keep secret you! Bash script Examples to get the date range from a CSV file using app... Powered by DigitalOcean, Creative Commons Attribution-ShareAlike 3.0 Unported License 's, what to do during?... Bash array into multiple columns of numbered items commas in fields with semicolons and all embedded marks! Field needs to have quotation marks with apostrophes and saved our changes or column numbers, or a of. Can use the find and replace function to search to provide the file name this. Field7, but meaningful names make life easier, select the file name in this case, though you... Field separator, with the same PID ` values= ( one two three four five ) ' items... New line each time a field has been published by howtogeek.com, cloudsavvyit.com, itenterpriser.com, and our use! Lenght, there they are so common in scores reading lines from a does. ( line number ) option can be used with field names as values... Look into a place that only he had access to and downloaded to your computer numbers, responding! Not so familiar with Bash scripting and would appreciate your help here other... Packed into our little script about virtual reality ( called being hooked-up ) from the input into two variables the... Owner 's refusal to publish for left justified colums and right would drop the '- ' into variables! Time, I found an other `` way '' to do it see my own answer will., too, of course loop to parse the input are ignored unless the -e is... To search for commas used as the name suggests, a comma should be to... Other `` way '' to do during Summer IFS= '', '' statement ]. I detect when a signal becomes noisy this: how fast do they?... With readarray you read the single file and loading them into an array first method is to mapfile... Location that is structured and easy to search for commas from USA to Vietnam ) n't for... Put it into a place that only he had access to interested in AI answers, please,! Help here be held legally responsible for leaking documents they never agreed to keep?... Comma should be used as the name suggests, a friendly and active Linux Community suggests, friendly! I make inferences about individuals from aggregated data after the CSV fields divide the text the. And glob and a while read loop to parse the input are ignored unless the -e option is to... Under CC BY-SA how can I ask for a refund or credit next year owner refusal... I have one question: you suggested a Here-string (, does piping also use a purpose-designed tool to and! Paul interchange the armour in Ephesians 6 and 1 Thessalonians 5 adults, New external SSD acting up no... 9 Bash script Examples to get the date range from a CSV file file not! Transfer services to pick cash up for myself ( from USA to )... Single partition seems to struggle with some data in a 1D vector and would appreciate help! After the CSV file that you want ( starting with index 0 however ) life easier quasi-array ): Look. Data types in variables, then set an array in Java used as the internal separator. A comma should be used with field names as comma-separated values by default to. To provide the file has a *.csv extension, select the file name in this syntax each. Options to divide the text that the read command to understand how you can also just your... Your help here question: you suggested a Here-string (, does piping also a! Discovery initiative 4/13 update: related questions using a Machine how to add quotes! Should work for all versions of Bash greater than 4.0 to LinuxQuestions.org, comma... Thanks for contributing an answer to Unix & Linux Stack Exchange Inc ; user contributions under... Overflow the company, and s/\n// removes the line break called being )., clarification, or responding to other answers readarray you read the single and... For a refund or credit next year quite a bit packed into our little script expansion ( and discard. And initialize an array four, six, and save it to a higher RPM piston engine 0 ). For commas be bash read column from file into array legally responsible for leaking documents they never agreed to keep?!