Results for “records”
Small, practical examples. Search by task or narrow things down below.
Remove duplicate records by a selected key
C#: DistinctBy keeps the first record for each key in encounter order.
C#✓ Tested
Separate records into two lists
Python: Build two explicit partitions so callers can use both matching and rejected values.
Python✓ Tested
Show the count of matching records
Show the count of matching records with a small React component and explicit browser behavior.
React✓ Tested
Sort records by a delimited field
Linux Commands: Select the exact sort key to avoid including later columns.
Linux Commands✓ Tested
Sort records by a selected field
Sort records by a selected field using a complete Go program with explicit sample inputs.
Go✓ Tested
Sort records by two fields
C++: Tuple comparison implements lexicographic ordering across several keys.
C++✓ Tested
Write object records to a CSV file
PowerShell: Export-Csv uses property names as headers and quotes values when needed.
PowerShell✓ Tested
Add a calculated property during selection
PowerShell: A calculated property can derive a value while retaining selected original properties.
PowerShell✓ Tested
Check for a hashtable key before reading it
PowerShell: ContainsKey distinguishes a missing key from a key whose value happens to be null.
PowerShell✓ Tested
Check whether a file is already sorted
Linux Commands: Use sort -C for a quiet status check that does not rewrite the file.
Linux Commands✓ Tested
Construct a record with named properties
PowerShell: PSCustomObject gives downstream pipeline commands meaningful property names.
PowerShell✓ Tested
Convert an object’s properties into a hashtable
PowerShell: Enumerate PSObject.Properties when the set of property names is known only at runtime.
PowerShell✓ Tested